home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Systemmonitors / SysLog V1.00 / Install < prev    next >
Text File  |  1996-09-26  |  9KB  |  332 lines

  1. ;
  2. ; SysLog Installation script
  3. ;
  4. ; Copyright © 1995 Petri Nordlund. All rights reserved.
  5. ;
  6. ; $Id: Install 1.4 1995/11/04 16:07:55 petrin Exp petrin $
  7. ;
  8. ; Languages available:
  9. ;   English (default)
  10. ;
  11.  
  12. ; =======================================================================
  13. ;   Set up some variables
  14. ; =======================================================================
  15.  
  16. (set OSVersion        (/ (getversion) 65536))
  17. (set WBVersion        (/ (getversion "libs:version.library") 65536))
  18. (set AGVersion        (/ (getversion "libs:amigaguide.library") 65536))
  19. (set TRUE        1)
  20. (set FALSE        0)
  21. (set startup_added    FALSE)
  22. (set prefs_written    FALSE)
  23.  
  24. ; =======================================================================
  25. ;   Set up localized strings
  26. ; =======================================================================
  27.  
  28. ;
  29. ; ===== English
  30. ;
  31. (set #kickstart37 "Sorry, but SysLog requires AmigaDos 2.04.")
  32. (set #begin_install "\nYou're about to install SysLog. If you need any help, just press the HELP-button.\n\nYou can always abort the installation and the installed parts will be safely deleted.\n\nIf you decide to uninstall SysLog, there's a program available for this purpose.")
  33. (set #uninstall "\n\n\n\nIf you want to uninstall SysLog, use the supplied uninstall program.\n\n\n\n")
  34. (set #dir_prompt "Where should SysLog be installed? A drawer named `SysLog' will be created there. If you're updating from a previous version, select the directory containing the SysLog drawer.")
  35. (set #dir_help "A good place to install SysLog is your WORK: partition or if it isn't available, the SYS: partition.\n\nIf you're updating from a previous version, you must select the directory where the SysLog drawer is, not the SysLog drawer. For example WORK: but not WORK:SysLog/.\n\n")
  36. (set #extract_progs "Copying executables")
  37. (set #installing_docs "Installing documentation")
  38. (set #doc_format "Please select documentation format:")
  39. (set #df_1 "AmigaGuide")
  40. (set #df_2 "ASCII text")
  41. (set #doc_askansi "\nDo you want to use ANSI format codes in the ASCII documentation?")
  42. (set #ansi_yes "Yes, use ANSI")
  43. (set #ansi_no "No, don't use ANSI")
  44. (set #conv_doc "Converting documentation")
  45. (set #addcmds "The following instructions will be added to your \"S:User-Startup\" file so that your system will be properly configured to use SysLog.\n\nPath %s Add\nRun <NIL: >NIL: %s/SysLogDaemon")
  46. (set #addhelp "This will add some commands to your S:User-Startup file to allow the correct operation of SysLog. SysLog will be started when you boot your Amiga.\n\n")
  47. (set #abort_remove "Installation aborted. Do you want to delete the files that were installed?\n\nIf you are updating an existing version of SysLog, it may have already been overwritten, so you must reinstall it.\n\n")
  48. (set #abort_rem_yes "Yes, remove")
  49. (set #abort_rem_no "No")
  50. (set #remcmds "\nCommands added to your \"S:User-Startup\" file will now be removed.")
  51. (set #remhelp "The installation program has added commands to your \"S:User-Startup\" file. These will now be removed, nothing else will be deleted or changed.\n\n")
  52. (set #userstartup "; SysLog installation was aborted.")
  53. (set #thanks "\nThank you for installing SysLog.\n\nNow you must reboot the machine to start the SysLogDaemon.")
  54.  
  55.  
  56. ; =======================================================================
  57. ;   Initialization
  58. ; =======================================================================
  59.  
  60. ; ===== Make sure that we are running under 2.04 or better
  61. (if (< OSVersion 37)
  62.     (abort #kickstart37)
  63. )
  64.  
  65. ; ===== Set up an error cleanup routine
  66. (onerror
  67.     (delete "RAM:tool")
  68.     (if (exists "SLDest:" (noreq))
  69.     (
  70.         (if (askbool
  71.             (prompt #abort_remove)
  72.             (help "")
  73.             (default 0)
  74.             (choices #abort_rem_yes #abort_rem_no))
  75.             (
  76.                 (run "delete SLDest:SysLog ALL FORCE QUIET")
  77.                 (delete "SLDest:SysLog.info")
  78.  
  79.                 (run "Delete DEVS:Mountlist.LOG FORCE QUIET")
  80.                 (run "Delete DEVS:DOSDrivers/LOG FORCE QUIET")
  81.                 (run "Delete DEVS:DOSDrivers/LOG.info FORCE QUIET")
  82.  
  83.                 (run "Delete L:LOG-Handler FORCE QUIET")
  84.                 (run "Delete LIBS:syslog.library FORCE QUIET")
  85.  
  86.                 (if (= startup_added TRUE)
  87.                     (startup "SysLog"
  88.                         (prompt (#remcmds))
  89.                         (help #remhelp @startup-help)
  90.                         (command #userstartup)
  91.                     )
  92.                 ) ;  end of if statement
  93.  
  94.             )
  95.         ) ; end of if statement
  96.  
  97.         (makeassign "SLSrc" (safe))
  98.         (makeassign "SLDest" (safe))
  99.     )) ; end of if statement
  100. ) ; end of onerror statement
  101.  
  102. (welcome #welcome)
  103.  
  104. ; =======================================================================
  105. ;   Begin installation
  106. ; =======================================================================
  107.  
  108. (complete 0)
  109.  
  110. (message #begin_install)
  111.  
  112. ; ===== cancel the assign in case of installation restart
  113. (makeassign "SLSrc" (safe))
  114. (makeassign "SLDest" (safe))
  115.  
  116. (transcript #uninstall)
  117.  
  118. (set SLDest
  119.     (tackon
  120.         (askdir
  121.             (prompt #dir_prompt)
  122.             (help #dir_help @askdir-help)
  123.             (default @default-dest)
  124.         )
  125.         "SysLog"
  126.     )
  127. )
  128.  
  129. (complete 5)
  130.  
  131. (makeassign "SLDest"
  132.     (pathonly SLDest)
  133.     (safe)
  134. )
  135.  
  136. (if (not (exists "SLDest:SysLog"))
  137.     (makedir "SLDest:SysLog")
  138. )
  139.  
  140. ; ===== Tell installer where SysLog will be installed
  141. (set @default-dest SLDest)
  142.  
  143. ; ===== Copy c/tool to RAM:
  144. (run "copy c/tool RAM:")
  145.  
  146. (complete 10)
  147.  
  148. ; ===== Copy executables
  149. (working #copy_progs)
  150. (copyfiles
  151.     (source "bin")
  152.     (dest "SLDest:SysLog")
  153.     (infos)
  154.     (all)
  155. )
  156.  
  157. (complete 15)
  158.  
  159. ; ===== Install documentation
  160. (
  161.     (working #installing_docs)
  162.  
  163.     (if (= AGVersion 0)
  164.         ; ASCII
  165.         (set gdefault 2)
  166.         ; AmigaGuide
  167.         (set gdefault 1)
  168.     )
  169.  
  170.     (set asciitype 0)
  171.  
  172.     (if (= @user-level 2)
  173.         (
  174.             (set gtype
  175.                 (askoptions
  176.                     (prompt #doc_format)
  177.                     (help @askchoice-help)
  178.                     (choices
  179.                         #df_1
  180.                         #df_2
  181.                     )
  182.                     (default gdefault)
  183.                 )
  184.             )
  185.             (if (IN gtype 1)
  186.                 (if (askbool
  187.                     (prompt #doc_askansi)
  188.                     (default 0)
  189.                     (help "")
  190.                     (choices #ansi_yes #ansi_no))
  191.                     (
  192.                         ; ANSI
  193.                         (set asciitype 1)
  194.                     )
  195.                 ) ; end of if statement
  196.             ) ; end of if statement
  197.         )
  198.         (
  199.             ; user is not expert, don't ask anything
  200.             (set gtype gdefault)
  201.         )
  202.     ) ; end of if statement
  203.  
  204.     (working #conv_doc)
  205.  
  206.     (if (IN gtype 0)
  207.     (
  208.         (if (>= AGVersion 39)
  209.             (run "copy doc/SysLog.guide SLDest:SysLog/")
  210.             (run "RAM:tool FROM=doc/SysLog.guide TO=SLDest:SysLog/SysLog.guide STRIPGUIDE")
  211.         )
  212.         (run "copy doc/SysLog.guide.info SLDest:SysLog/")
  213.     ))
  214.     (if (IN gtype 1)
  215.     (
  216.         (if (= asciitype 0)
  217.             (run "RAM:tool FROM=doc/SysLog.guide TO=SLDest:SysLog/SysLog.doc GUIDETOTEXT")
  218.             (run "RAM:tool FROM=doc/SysLog.guide TO=SLDest:SysLog/SysLog.doc GUIDETOTEXT ANSI")
  219.         )
  220.         (run "copy doc/SysLog.doc.info SLDest:SysLog/")
  221.     ))
  222.  
  223.     ; gtype is used later in this file also, see icon installation
  224. )
  225.  
  226. (complete 30)
  227.  
  228. (if (>= WBVersion 39)
  229. (
  230.     ; 3.0+
  231.     (run "RAM:tool ICON=SLDest:SysLog/SysLog.guide.info CHANGETOOL DEFTOOL=Multiview")
  232.     (run "RAM:tool ICON=SLDest:SysLog/SysLog.doc.info CHANGETOOL DEFTOOL=Multiview")
  233. )
  234. (
  235.     ; 2.x
  236.     (run "RAM:tool ICON=SLDest:SysLog/SysLog.guide.info CHANGETOOL DEFTOOL=AmigaGuide")
  237.     (run "RAM:tool ICON=SLDest:SysLog/SysLog.doc.info CHANGETOOL DEFTOOL=more")
  238. )) ; end of if statement
  239.  
  240. (if (NOT (IN gtype 0))
  241.     (delete "SLDest:SysLog/SysLog.guide.info")
  242. ) ; end of if statement
  243.  
  244. (if (NOT (IN gtype 1))
  245.     (delete "SLDest:SysLog/SysLog.doc.info")
  246. ) ; end of if statement
  247.  
  248. (complete 40)
  249.  
  250. ; ===== Copy syslog.library
  251. (copylib
  252.     (source "libs/syslog.library")
  253.     (dest "LIBS:")
  254. )
  255.  
  256. (complete 50)
  257.  
  258. ; ===== Copy LOG-Handler
  259. (copylib
  260.     (source "l/LOG-Handler")
  261.     (dest "L:")
  262. )
  263.  
  264. ; ===== Copy Mountlists
  265. (copyfiles
  266.     (source "devs/Mountlist")
  267.     (dest "DEVS:")
  268.     (newname "Mountlist.LOG")
  269. )
  270. (copyfiles
  271.     (source "devs/DOSDrivers")
  272.     (dest "DEVS:DOSDrivers/")
  273.     (all)
  274. )
  275.  
  276. ; ===== Copy .conf-files
  277. (copyfiles
  278.     (source "s")
  279.     (dest "SLDest:SysLog")
  280.     (all)
  281. )
  282.  
  283. ; ===== UnInstall
  284. (copyfiles
  285.     (source "UnInstall")
  286.     (dest "SLDest:SysLog/")
  287.     (all)
  288. )
  289. (run "RAM:tool ICON=SLDest:SysLog/UnInstall.info ADDTT TOOLTYPE=\"DEFUSER=Expert\"")
  290.  
  291. (complete 60)
  292.  
  293. ; ===== Copy developer files
  294. (copyfiles
  295.     (source "Developer")
  296.     (dest "SLDest:SysLog/Developer")
  297.     (all)
  298. )
  299.  
  300. (complete 80)
  301.  
  302. ; ===== Copy directory icon
  303. (copyfiles
  304.     (source "dir_icon")
  305.     (dest "SLDest:")
  306.     (newname "SysLog.info")
  307. )
  308.  
  309. (complete 90)
  310.  
  311. ; ===== Add commands to s:user-startup
  312. (startup "SysLog"
  313.     (prompt (#addcmds SLDest SLDest))
  314.     (help #addhelp @startup-help)
  315.     (command ("PATH %s Add\n" SLDest))
  316.     (command ("Run <NIL: >NIL: %s/SysLogDaemon\n" SLDest))
  317. )
  318. (set startup_added TRUE)
  319.  
  320. ; =======================================================================
  321. ;   Cleanup
  322. ; =======================================================================
  323.  
  324. (complete 100)
  325.  
  326. (delete "RAM:tool")
  327.  
  328. (makeassign "SLSrc" (safe))
  329. (makeassign "SLDest" (safe))
  330.  
  331. (exit #thanks)
  332.